package task3.sink;

import java.io.StreamCorruptedException;
import task3.pimpmypipe.Readable;
import task3.pimpmypipe.Writeable;
import task3.util.FilterObservable;
import task3.util.ImageTO;

public class Sink
  implements Writeable<ImageTO>
{
  private FilterObservable _observable;
  
  public Sink()
  {
    this._observable = new FilterObservable();
  }
  
  public void write(ImageTO value)
    throws StreamCorruptedException
  {
    this._observable.setChanged();
    this._observable.notifyObservers(value);
  }
  
  public void setInput(Readable<ImageTO> input)
  {
    throw new UnsupportedOperationException();
  }
  
  public FilterObservable getObservable()
  {
    return this._observable;
  }
}
